*------------------------------------------------------------------------------*
* Family history - Dinas, Fouka, Schläpfer - JoP
*------------------------------------------------------------------------------*

*------------------------------------------------------------------------------*
* Table D10
*------------------------------------------------------------------------------*



*------------------------------------------------------------------------------*
* Greece
*------------------------------------------------------------------------------*

use greece, clear

local treatment T
local controls female i.age i.edu i.occupation i.income i.nomos 
estimates clear
foreach x in reason_warst reason_econ_recst reason_polst reason_benefits_recst {
	reg `x' asiaminor##T, cl(municipality)
	eststo m_`x'
	reg `x' asiaminor##T `controls', cl(municipality)
	eststo m_`x'_c
}
esttab m* using Table_D10_GR.html, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2) keep(1.asiaminor 1.T 1.asiaminor#1.T) nogaps 

gen asia_T=asiaminor*T
gen nonasia_T=(1-asiaminor)*T

foreach x in reason_warst reason_econ_recst reason_polst reason_benefits_recst {
	reg `x' asiaminor nonasia_T asia_T, cl(municipality)
	eststo e_`x'
	reg `x' asiaminor nonasia_T asia_T  `controls', cl(municipality)
	eststo e_`x'_c
}

esttab e_* using Table_D10_GR_addline.html, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2) keep(asia_T) nogaps 


*------------------------------------------------------------------------------*
* Germany
*------------------------------------------------------------------------------*

use germany, clear

local treatment t1
local controls i.sex i.state i.age i.F4 i.F13
estimates clear
foreach x in reason_war_st reason_econ_st reason_pol_st reason_benefits_st {
	reg `x' expellee##t1, cl(GKZ)
	eststo m_`x'
	reg `x' expellee##t1 `controls', cl(GKZ)
	eststo m_`x'_c
}
esttab m* using Table_D10_DE.html, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep(1.expellee 1.t1 1.expellee#1.t1) nogaps 
		
gen expellee_T=expellee*t1
gen nonexpellee_T=(1-expellee)*t1

foreach x in reason_war_st reason_econ_st reason_pol_st reason_benefits_st {
	reg `x' expellee nonexpellee_T expellee_T, cl(GKZ)
	eststo e_`x'
	reg `x' expellee nonexpellee_T expellee_T `controls', cl(GKZ)
	eststo e_`x'_c
}

esttab e_* using Table_D10_DE_addline.html, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) replace ///
		cells(b(fmt(a2) star) se(fmt(a2) par)) stats(N r2)  ///
		keep(expellee_T) nogaps 
